#include <bits/stdc++.h>
using namespace std;
int main(){
	int n,m,t;
	cin>>n>>m>>t;
	int sum;
	sum=n+m;
	int a[100];
	int i=0;
do{	
	a[i]=sum%8;
	sum=sum/8; 
	i++;	
	}while(sum!=0);
	for(int j=i-1;j>=0;j--){
		cout<<a[j];
	}
	cout<<endl;	
return 0;
	
}
